package com.people.core.validator.annotation;

import com.people.core.validator.valid.GraphEdgeValueValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 图edge校验，校验参数
 *
 * @author zhenglin
 * @date 2022/3/22 10:42
 */
@Documented
@Constraint(validatedBy = GraphEdgeValueValidator.class)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface GraphEdgeValue {

	String message() default "无效的edge(边)值";

	Class[] groups() default {};

	Class<? extends Payload>[] payload() default {};

	/**
	 * 指定范围值
	 * @return 默认值
	 */
	String[] values() default {};


	@Target({ElementType.FIELD, ElementType.PARAMETER})
	@Retention(RUNTIME)
	@Documented
	@interface List {
		GraphEdgeValue[] value();
	}
}
